update to master versions
authormkrzewic <mikolaj.krzewicki@cern.ch>
Mon, 29 Sep 2014 12:06:55 +0000 (14:06 +0200)
committermkrzewic <mikolaj.krzewicki@cern.ch>
Mon, 29 Sep 2014 12:06:55 +0000 (14:06 +0200)
13 files changed:
PWGCF/Correlations/JCORRAN/AliJCORRAN.cxx
PWGCF/Correlations/JCORRAN/AliJCORRANTask.cxx
PWGCF/Correlations/JCORRAN/AliJCORRANTask.h
PWGCF/Correlations/JCORRAN/AliJConst.h
PWGCF/Correlations/JCORRAN/AliJCorrelations.cxx
PWGCF/Correlations/JCORRAN/AliJDataManager.cxx
PWGCF/Correlations/JCORRAN/AliJEventPool.cxx
PWGCF/Correlations/JCORRAN/AliJPhoton.cxx
PWGCF/Correlations/macros/jcorran/AddTaskJCORRANFilter.C
PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskJetShapeConst.cxx
PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskJetShapeDeriv.cxx
PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskPtEMCalTrigger.cxx
PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskPtEMCalTrigger.h

index 83996d7..39b3e85 100644 (file)
@@ -247,13 +247,13 @@ void AliJCORRAN::UserCreateOutputObjects(){
 
     //cout<<kParticleTypeStrName[kPhoton]<<" "<<kParticleTypeStrName[fjtrigg]<<endl;
     // EventPool for Mixing
-    fphotonPool  = new AliJEventPool( fcard, fhistos, fcorrelations, kPhoton);  // for pi0 mass
+    fphotonPool  = new AliJEventPool( fcard, fhistos, fcorrelations, kJPhoton);  // for pi0 mass
     fassocPool   = new AliJEventPool( fcard, fhistos, fcorrelations, fjassoc);
 
-    fphotonList = new TClonesArray(kParticleProtoType[kPhoton],1500);      
+    fphotonList = new TClonesArray(kParticleProtoType[kJPhoton],1500);      
     //     TClonesArray *cellList = new TClonesArray("AliJCaloCell",1500);      
-    fchargedHadronList  = new TClonesArray(kParticleProtoType[kHadron],1500);      
-    fpizeroList = new TClonesArray(kParticleProtoType[kPizero],1500);      
+    fchargedHadronList  = new TClonesArray(kParticleProtoType[kJHadron],1500);      
+    fpizeroList = new TClonesArray(kParticleProtoType[kJPizero],1500);      
     ftriggList  = new TClonesArray(kParticleProtoType[fjtrigg],1500);      
     fassocList  = new TClonesArray(kParticleProtoType[fjassoc],1500);      
     fpairList     = new TClonesArray(kParticleProtoType[fjtrigg],1500);      
@@ -416,11 +416,11 @@ void AliJCORRAN::UserExec(){
        // Triggers and associated
        //----------------------ooooo---------------------------------------
 
-       if(fjtrigg==kPizero || fjassoc==kPizero || fjtrigg==kPhoton || fjassoc==kPhoton){
+       if(fjtrigg==kJPizero || fjassoc==kJPizero || fjtrigg==kJPhoton || fjassoc==kJPhoton){
        } // pizero || photon
-       if(fjtrigg==kHadron || fjassoc==kHadron){
+       if(fjtrigg==kJHadron || fjassoc==kJHadron){
                fchargedHadronList->Clear();
-               fdmg->RegisterList(fchargedHadronList, NULL, cBin, zBin, kHadron);
+               fdmg->RegisterList(fchargedHadronList, NULL, cBin, zBin, kJHadron);
                // apply efficiencies
 
                for( int i = 0; i < fchargedHadronList->GetEntries(); i++ ){
@@ -435,9 +435,9 @@ void AliJCORRAN::UserExec(){
        }
 
        //---- assign input list ---- 
-       if(fjtrigg==kPizero)      finputList = fpizeroList;  
-       else if(fjtrigg==kHadron) finputList = fchargedHadronList;
-       else if(fjtrigg==kPhoton) finputList = fphotonList;
+       if(fjtrigg==kJPizero)      finputList = fpizeroList;  
+       else if(fjtrigg==kJHadron) finputList = fchargedHadronList;
+       else if(fjtrigg==kJPhoton) finputList = fphotonList;
        int noAllTriggTracks = finputList->GetEntries();
        int noAllChargedTracks = fchargedHadronList->GetEntries();
        fhistos->fhChargedMult[cBin]->Fill(noAllChargedTracks);
@@ -568,7 +568,7 @@ void AliJCORRAN::UserExec(){
                        }
                }
                if(lpPairCounter->Exists()){
-                       pairTr->SetParticleType(kHadron);
+                       pairTr->SetParticleType(kJHadron);
                        //double effCorr = 1./fcard->TrackEfficiency(lpTrackCounter->GetLPpt());
                        fhistos->fhLPpairPt->Fill(pairTr->Pt());
                }
@@ -580,9 +580,9 @@ void AliJCORRAN::UserExec(){
        fassocList->Clear();
        int noAssocs=0;
        double  sumPtAroundLP = 0;
-       if(fjassoc==kPizero) finputList = fpizeroList;  
-       else if(fjassoc==kHadron) finputList = fchargedHadronList;
-       else if(fjassoc==kPhoton) finputList = fphotonList;
+       if(fjassoc==kJPizero) finputList = fpizeroList;  
+       else if(fjassoc==kJHadron) finputList = fchargedHadronList;
+       else if(fjassoc==kJPhoton) finputList = fphotonList;
 
        int noAllAssocTracks = finputList->GetEntries();
 
index 4f7e844..30c3251 100644 (file)
 AliJCORRANTask::AliJCORRANTask() :   
     AliAnalysisTaskSE("PWG4JCORRAN"),
     fFilter(0x0),
-    fAODName("jcorran.root"),
-    fJODTree(0x0),
-    fAliJRunHeader(0x0),
-    fDoStoreJOD(kFALSE)
-
+    fAliJRunHeader(0x0)
 {
 
   DefineInput (0, TChain::Class());
-  DefineOutput (1, TTree::Class());
-  DefineOutput (2, TList::Class());
   
    fFilter = new AliJFilter();
 }
@@ -63,10 +57,7 @@ AliJCORRANTask::AliJCORRANTask() :
 AliJCORRANTask::AliJCORRANTask(const char *name, TString inputformat):
     AliAnalysisTaskSE(name), 
     fFilter(0x0),
-    fAODName("jcorran.root"),
-    fJODTree(0x0),
-    fAliJRunHeader(0x0),
-    fDoStoreJOD(kFALSE)
+    fAliJRunHeader(0x0)
 {
   // Constructor
   AliInfo("---- AliJCORRANTask Constructor ----");
@@ -74,8 +65,6 @@ AliJCORRANTask::AliJCORRANTask(const char *name, TString inputformat):
   JUNUSED(inputformat);
 
   DefineInput (0, TChain::Class());
-  DefineOutput (1, TTree::Class());
-  DefineOutput (2, TList::Class());
 
    fFilter = new AliJFilter( Form("%sFilter",name), this );
 }
@@ -84,10 +73,7 @@ AliJCORRANTask::AliJCORRANTask(const char *name, TString inputformat):
 AliJCORRANTask::AliJCORRANTask(const AliJCORRANTask& ap) :
     AliAnalysisTaskSE(ap.GetName()), 
     fFilter(ap.fFilter),
-    fAODName(ap.fAODName),
-    fJODTree(ap.fJODTree),
-    fAliJRunHeader(ap.fAliJRunHeader),
-    fDoStoreJOD(ap.fDoStoreJOD)
+    fAliJRunHeader(ap.fAliJRunHeader)
 { 
 
   AliInfo("----DEBUG AliJCORRANTask COPY ----");
@@ -111,7 +97,6 @@ AliJCORRANTask::~AliJCORRANTask()
   // destructor 
 
    delete fFilter;
-   delete fJODTree;
    delete fAliJRunHeader;
 
 }
@@ -135,32 +120,6 @@ void AliJCORRANTask::UserCreateOutputObjects()
    fFilter->SetAliJRunHeader( fAliJRunHeader );
    fFilter->UserCreateOutputObjects();
 
-  // register ouput branches
-
-  if(fDoStoreJOD){
-               TFile * file1 = OpenFile(1);
-               file1-> SetCompressionLevel(9);
-               TTree * tree = new TTree("JODTree","JYFL Object Data");
-               int split = 2;
-               int basketsize = 32000;
-               tree->Branch("TrackList", fFilter->GetTrackList(),basketsize, split);
-               if( fFilter->IsMC() ) 
-                               tree->Branch("MCTrackList", fFilter->GetMCTrackList(),basketsize, split );
-               //== Event Header
-               tree->Branch("HeaderList", fFilter->GetHeaderList(),basketsize, split );
-               //== EventPlane SRC
-               if( fFilter->GetStoreEventPlaneSource() ){
-                               tree->Branch("AliESDVZERO", fFilter->GetESDVZERO());
-                               tree->Branch("AliESDTZERO", fFilter->GetESDTZERO());
-                               tree->Branch("AliESDZDC",   fFilter->GetESDZDC());
-               }
-               fJODTree = tree;
-  }
-
-  PostData( 1, fJODTree );
-  //OpenFile(2);
-  PostData( 2,fFilter->GetRunInfoList());
-
 
   cout << "Add(fAliRunHeader) in UserCreateObject() ======= " << endl;
 
@@ -176,15 +135,6 @@ void AliJCORRANTask::UserExec(Option_t* /*option*/)
 
        fFilter->UserExec("");
 
-       if(  1 || fFilter->GetEventSuccess() ){ // TODO
-               if( fDoStoreJOD ){
-                       fJODTree->Fill();
-               }
-       }
-       PostData(1,fJODTree);
-       PostData(2,fFilter->GetRunInfoList());
-
-
        if(fDebug > 5) cout << "\t------- End UserExec "<<endl;
 }
 
@@ -195,31 +145,14 @@ void AliJCORRANTask::Init()
        AliInfo("Doing initialization") ; 
 
        fFilter->Init();
-
-       //   TString formula(fEsdTrackCuts->GetMaxDCAToVertexXYPtDep());
-       //   if(formula.Length()>0){ // momentum dep DCA cut for AOD
-       //     formula.ReplaceAll("pt","x");
-       //   }
 }
 
 //______________________________________________________________________________
-void AliJCORRANTask::Terminate(Option_t * option)
+void AliJCORRANTask::Terminate(Option_t *)
 {
        fFilter->Terminate();
 
        // Processing when the event loop is ended
        fAliJRunHeader->PrintOut();
        cout<<"AliJCORRANTask Analysis DONE !!"<<endl; 
-       // Printout fRunInfoList here
-       TList* fRunInfoList = dynamic_cast<TList*> (GetOutputData(1));
-       if(fRunInfoList)
-       {
-               AliJRunHeader *fAliRunHeader = dynamic_cast<AliJRunHeader*> (fRunInfoList->FindObject("AliJRunHeader"));
-               if(fAliRunHeader) {fAliRunHeader->Print();}
-       }
-       else
-       {
-               cout << "WARNING : Run Information List is empty" << endl;
-       }
-
 }
index abea78a..98319c4 100644 (file)
@@ -79,28 +79,18 @@ class AliJCORRANTask : public AliAnalysisTaskSE {
   virtual void Init();   
   virtual void LocalInit() { Init(); }
   virtual void UserExec(Option_t *option);
-  virtual void Terminate(Option_t* option="");
+  virtual void Terminate(Option_t* );
 
   AliJFilter *GetFilter() { return fFilter; }
 
   AliJRunHeader * GetJRunHeader(){ return fAliJRunHeader; }
   void SetJRunHeader( AliJRunHeader * hdr ){ fAliJRunHeader = hdr ; }
-  void SetOutputAODName(const char* aodname){ fAODName=aodname;}
-  TString *GetOutputAODName() {return &fAODName;}
-
-  void SetDoStoreJOD(Bool_t doeff){ fDoStoreJOD=doeff; }
-  Bool_t GetDoStoreJOD(){ return fDoStoreJOD; }
 
  private:
   
   AliJFilter *fFilter; // filter object
-  TString fAODName; //output delta AOD name
-  TTree      *fJODTree;
   AliJRunHeader * fAliJRunHeader;
 
-  Bool_t fDoStoreJOD;
-
-
-  ClassDef(AliJCORRANTask, 2); 
+  ClassDef(AliJCORRANTask, 3); 
 };
 #endif // AliJCORRANTask_H
index 93af311..65a2ac0 100644 (file)
@@ -54,7 +54,7 @@ const double kPionMass     = .1395675;
 
 //====================== particle types ============================================
 const int kNumberOfParticleTypes = 10;
-enum particleType   {kHadron, kPion, kKaon, kProton, kPhoton, kDecayphoton, kPizero, kEta,kHadronMC, kJet, kJNone};
+enum particleType   {kJHadron, kJPion, kJKaon, kJProton, kJPhoton, kJDecayphoton, kJPizero, kJEta,kJHadronMC, kJJet, kJNone};
 
 const char* const kParticleTypeStrName[kNumberOfParticleTypes] =
                     {"hadron", "pion", "kaon", "proton", "photon", "decayphoton", "pizero", "eta", "hadronMC", "none"};
index 333139b..21037e6 100644 (file)
@@ -248,7 +248,7 @@ void AliJCorrelations::FillAzimuthHistos(fillType fTyp, int CentBin, int ZBin, A
 {
   // histo filler
   bool twoTracks = false;
-  if(ftk1->GetParticleType()==kHadron && ftk2->GetParticleType()==kHadron) twoTracks =true;
+  if(ftk1->GetParticleType()==kJHadron && ftk2->GetParticleType()==kJHadron) twoTracks =true;
   
   //double-counting check
   if(fTyp == kReal && twoTracks && ftk1->GetID()==ftk2->GetID()) return;
index 3352b6c..8a6460e 100644 (file)
@@ -256,11 +256,11 @@ void AliJDataManager::RegisterList(TClonesArray* listToFill, TClonesArray* listF
 
     switch (whatToFill) {
 
-        case kPhoton:
+        case kJPhoton:
             break;
-        case kPizero:
+        case kJPizero:
             break;
-        case kHadron:       
+        case kJHadron:       
             noIn    = fTrackList->GetEntriesFast(); 
             counter = 0;
             {
@@ -283,14 +283,14 @@ void AliJDataManager::RegisterList(TClonesArray* listToFill, TClonesArray* listF
                             && fCard->IsInEtaRange(cgl->Eta()) 
                       ){  // 
                         cgl->SetID(ii);
-                        cgl->SetParticleType(kHadron);
+                        cgl->SetParticleType(kJHadron);
                         new ((*listToFill)[counter++]) AliJTrack(*cgl);
                     }
                 }
             }
             break;
 
-        case kProton:       
+        case kJProton:       
             noIn    = fTrackList->GetEntriesFast(); 
             counter = 0;
             for(int ii=0;ii<noIn;ii++){ // loop for all tracks 
@@ -304,7 +304,7 @@ void AliJDataManager::RegisterList(TClonesArray* listToFill, TClonesArray* listF
                         && prob > 0.9
                   ){  // All cuts applied in the Train production stage
                     cgl->SetID(ii);
-                    cgl->SetParticleType(kHadron);
+                    cgl->SetParticleType(kJHadron);
                     new ((*listToFill)[counter++]) AliJTrack(*cgl);
                 }
             }
index 882cd11..cce620c 100644 (file)
@@ -154,11 +154,11 @@ void AliJEventPool::AcceptList(TClonesArray *inList, float cent, float Z, float
 
     fLists[cBin][fwhereToStore[cBin]]->Clear();
     for(int i=0;i<inList->GetEntriesFast();i++){
-                               if( fthisPoolType == kPhoton || fthisPoolType == kDecayphoton ){
+                               if( fthisPoolType == kJPhoton || fthisPoolType == kJDecayphoton ){
                                        AliJPhoton *tkp = (AliJPhoton*)inList->At(i);
                                        new ((*fLists[cBin][fwhereToStore[cBin]])[i]) AliJPhoton(*tkp);
                                }
-                               else if( fthisPoolType == kPizero || fthisPoolType == kEta ){
+                               else if( fthisPoolType == kJPizero || fthisPoolType == kJEta ){
                                        AliJPiZero *tkpz = (AliJPiZero*)inList->At(i);
                                        new ((*fLists[cBin][fwhereToStore[cBin]])[i]) AliJPiZero(*tkpz);
                                }
index 35068cd..40ae925 100644 (file)
@@ -314,12 +314,12 @@ particleType AliJPhoton::GetParticleType() {
     }
     
   
-   particleType pdg = kHadron;
+   particleType pdg = kJHadron;
 
   //Select most probable ID
   if(fCaloType == kPHOSCalo){
-    if(fCaloPID[kPhotonAli] > wPhoton) pdg = kPhoton ;
-    else if(fCaloPID[kPi0Ali] > wPi0) pdg = kPizero ; 
+    if(fCaloPID[kPhotonAli] > wPhoton) pdg = kJPhoton ;
+    else if(fCaloPID[kPi0Ali] > wPi0) pdg = kJPizero ; 
     //else if(fCaloPID[kElectronAli] > wElectron)  pdg = electron ;
     //else if(fCaloPID[kEleConAli] >  wElectron) pdg = electronCon ;
     //else if(chargedHadronWeight > wCharged) pdg = chargedHadron ;  
@@ -331,8 +331,8 @@ particleType AliJPhoton::GetParticleType() {
   }
   else{//EMCAL
     //Temporal solution, electrons and photons not differenciated
-    if(fCaloPID[kPhotonAli] + fCaloPID[kElectronAli]  > wPhoton) pdg = kPhoton ;
-    else if(fCaloPID[kPi0Ali] > wPi0) pdg = kPizero ; 
+    if(fCaloPID[kPhotonAli] + fCaloPID[kElectronAli]  > wPhoton) pdg = kJPhoton ;
+    else if(fCaloPID[kPi0Ali] > wPi0) pdg = kJPizero ; 
     //else if(chargedHadronWeight + neutralHadronWeight > wCharged) pdg = chargedHadron ;  
     //else if(neutralHadronWeight + chargedHadronWeight > wNeutral) pdg = neutralHadron ; 
     //else pdg =  neutralUnknown ;
index 4aa4e92..bc230ea 100755 (executable)
@@ -1,12 +1,11 @@
-const Bool_t IsMC = kFALSE; //With real data kMC = kFALSE
 const TString kInputData = "AOD";
 const TString kJCORRANInputFormat = "AOD"; // ESD, AODout, AODin
-const Bool_t kDoStoreJOD = kTRUE;
 
 //_____________________________________________________________________
-AliAnalysisTask *AddTaskJCORRANFilter(){
+AliAnalysisTask *AddTaskJCORRANFilter(Bool_t IsMC = kFALSE, Int_t beamtype = 1){
     // Load Custom Configuration and parameters
     // override values with parameters
+       cout <<"AddTaskJCORRANFilter:: IsMC = "<< IsMC <<"\t beamtype = "<< beamtype <<endl;
     UInt_t triggerSelection;
 
     AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
@@ -34,14 +33,11 @@ AliAnalysisTask *AddTaskJCORRANFilter(){
 
     //==== JCORRAN TASK
     AliJCORRANTask *jctask = new AliJCORRANTask("PWGCFJCORRANTask",kJCORRANInputFormat);
-    jctask->SetOutputAODName("jcorran.root");
     jctask->SetDebugLevel(0);
-    jctask->SetDoStoreJOD( kDoStoreJOD );
-    cout<<"DEBUG 4"<< jctask->GetDoStoreJOD() <<"\t"<<kDoStoreJOD<<endl;
 
     AliJRunHeader * hdr = new AliJRunHeader;
     hdr->SetIsMC( IsMC );
-    hdr->SetBeamTypeI( 0 ); // 0:pp 1:PbPb
+    hdr->SetBeamTypeI( beamtype ); // 0:pp 1:PbPb
     hdr->SetWithoutSDD(false);
     hdr->SetRunType("LHC13c");
     hdr->SetInputFormat( 1 ); // 0: ESD;
@@ -72,12 +68,6 @@ AliAnalysisTask *AddTaskJCORRANFilter(){
 
 // Connect input/output
        mgr->ConnectInput(jctask, 0, cinput);
-       if( kDoStoreJOD ){ 
-               AliAnalysisDataContainer *runinfoOutput = mgr->CreateContainer("RunInfo",  TList::Class(), AliAnalysisManager::kOutputContainer, "jcorran.root");
-               AliAnalysisDataContainer *treeOutput = mgr->CreateContainer("JODTree",  TTree::Class(), AliAnalysisManager::kOutputContainer, "jcorran.root");
-               mgr->ConnectOutput(jctask, 1, treeOutput );
-               mgr->ConnectOutput(jctask, 2, runinfoOutput );
-       }
 
        return jctask;
 }
index a7435e0..648bf33 100644 (file)
@@ -178,8 +178,8 @@ void AliAnalysisTaskJetShapeConst::UserCreateOutputObjects()
   }
 
   Int_t nBinsDM  = 100;
-  Double_t minDM = -50.;
-  Double_t maxDM = 50.;
+  Double_t minDM = -25.;
+  Double_t maxDM = 25.;
   if(fJetMassVarType==kRatMPt) {
     nBinsDM = 100;
     minDM   = -0.5;
@@ -234,7 +234,7 @@ void AliAnalysisTaskJetShapeConst::UserCreateOutputObjects()
 
     histName = Form("fh3PtTrueDeltaMRelDR_%d",i);
     histTitle = Form("fh3PtTrueDeltaMRelDR_%d;#it{p}_{T,true};Rel #Delta %s",i,varName.Data());
-    fh3PtTrueDeltaMRelDR[i] = new TH3F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,200,-1.,1.,nBinsDRToLJ,minDRToLJ,maxDRToLJ);
+    fh3PtTrueDeltaMRelDR[i] = new TH3F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,400,-1.,3.,nBinsDRToLJ,minDRToLJ,maxDRToLJ);
     fOutput->Add(fh3PtTrueDeltaMRelDR[i]);
 
     histName = Form("fhnMassResponse_%d",i);
index 8b73193..9fec0a8 100644 (file)
@@ -230,8 +230,8 @@ void AliAnalysisTaskJetShapeDeriv::UserCreateOutputObjects()
   }
 
   Int_t nBinsDM  = 100;
-  Double_t minDM = -50.;
-  Double_t maxDM = 50.;
+  Double_t minDM = -25.;
+  Double_t maxDM = 25.;
   if(fJetMassVarType==kRatMPt) {
     nBinsDM = 100;
     minDM   = -0.5;
@@ -294,7 +294,7 @@ void AliAnalysisTaskJetShapeDeriv::UserCreateOutputObjects()
 
     histName = Form("fh3PtTrueDeltaMRelDR_%d",i);
     histTitle = Form("fh3PtTrueDeltaMRelDR_%d;#it{p}_{T,true};Rel #Delta %s",i,varName.Data());
-    fh3PtTrueDeltaMRelDR[i] = new TH3F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,200,-1.,1.,nBinsDRToLJ,minDRToLJ,maxDRToLJ);
+    fh3PtTrueDeltaMRelDR[i] = new TH3F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,400,-1.,3.,nBinsDRToLJ,minDRToLJ,maxDRToLJ);
     fOutput->Add(fh3PtTrueDeltaMRelDR[i]);
 
     histName = Form("fhnMassResponse_%d",i);
index d89db43..e2b3e7c 100644 (file)
@@ -180,19 +180,25 @@ namespace EMCalTriggerPtAnalysis {
                TAxis hclusteraxes[4];
                DefineAxis(hclusteraxes[0], "energy", "E (GeV)", ptbinning);
                DefineAxis(hclusteraxes[1], "zvertex", "z_{V} (cm)", zvertexBinning);
-               DefineAxis(hclusteraxes[2], "pileup", "Pileup rejection", 2, -0.5, 1.5);
+               DefineAxis(hclusteraxes[2], "pileup", "Pileup rejection", 2,1 -0.5, 1.5);
                DefineAxis(hclusteraxes[3], "mbtrigger", "Has MB trigger", 2, -0.5, 1.5);
                const TAxis *clusteraxes[4];
                for(int iaxis = 0; iaxis < 4; ++iaxis) clusteraxes[iaxis] = hclusteraxes + iaxis;
+               TAxis hpatchaxes[3];
+               DefineAxis(hpatchaxes[0], "energy", "Patch energy (GeV)", 100, 0., 100.);
+               DefineAxis(hpatchaxes[1], "eta", "#eta", etabinning);
+               DefineAxis(hpatchaxes[2], "phi", "#phi",  20, 0, 2 * TMath::Pi());
+               const TAxis *patchaxes[3];
+               for(int iaxis = 0; iaxis < 3; ++iaxis) patchaxes[iaxis] = hpatchaxes + iaxis;
                try{
                        std::string patchnames[] = {"Level0", "JetHigh", "JetLow", "GammaHigh", "GammaLow"};
                        for(std::string * triggerpatch = patchnames; triggerpatch < patchnames + sizeof(patchnames)/sizeof(std::string); ++triggerpatch){
-                               fHistos->CreateTH1(Form("Energy%s", triggerpatch->c_str()), Form("Patch energy for %s trigger patches", triggerpatch->c_str()), 100, 0., 100.);
-                               fHistos->CreateTH1(Form("EnergyMain%s", triggerpatch->c_str()), Form("Patch energy for main %s trigger patches", triggerpatch->c_str()), 100, 0., 100.);
+                               fHistos->CreateTHnSparse(Form("Energy%s", triggerpatch->c_str()), Form("Patch energy for %s trigger patches", triggerpatch->c_str()), 3, patchaxes);
+                               fHistos->CreateTHnSparse(Form("EnergyMain%s", triggerpatch->c_str()), Form("Patch energy for main %s trigger patches", triggerpatch->c_str()), 3, patchaxes);
                        }
 
                        // Create histogram for MC-truth
-                       fHistos->CreateTHnSparse("hMCtrueParticles", "Particle-based histogram for MC-true particles", 3, trackaxes);
+                       fHistos->CreateTHnSparse("hMCtrueParticles", "Particle-based histogram for MC-true particles", 5, trackaxes);
                        for(std::map<std::string,std::string>::iterator it = triggerCombinations.begin(); it != triggerCombinations.end(); ++it){
                                const std::string name = it->first, &title = it->second;
                                // Create event-based histogram
@@ -238,48 +244,40 @@ namespace EMCalTriggerPtAnalysis {
                // Common checks: Have SPD vertex and primary vertex from tracks, and both need to have at least one contributor
                AliDebug(1,Form("Number of calibrated clusters: %d", fCaloClusters->GetEntries()));
                AliDebug(1,Form("Number of matched tracks: %d", fTracks->GetEntries()));
-
                if(fMCEvent){
-                       for(int ipart = 0; ipart < fMCEvent->GetNumberOfTracks(); ipart++){
-                               // Select only physical primary particles
-                               AliVParticle *part = fMCEvent->GetTrack(ipart);
-                               if(!fEtaRange.IsInRange(part->Eta())) continue;
-                               if(!fPtRange.IsInRange(part->Pt())) continue;
-                               if(!fMCEvent->IsPhysicalPrimary(ipart)) continue;
-                               FillMCParticleHist(part);
-                       }
                        // Build always trigger strig from the trigger maker in case of MC
-               fUseTriggersFromTriggerMaker = kTRUE;
+                       fUseTriggersFromTriggerMaker = kTRUE;
                }
 
                // Loop over trigger patches, fill patch energy
                AliEmcalTriggerPatchInfo *triggerpatch(NULL);
                TIter patchIter(this->fTriggerPatchInfo);
                while((triggerpatch = dynamic_cast<AliEmcalTriggerPatchInfo *>(patchIter()))){
+                       double triggerpatchinfo[3] = {triggerpatch->GetPatchE(), triggerpatch->GetEtaCM(), triggerpatch->GetPhiCM()};
                        if(triggerpatch->IsJetHigh()){
-                               fHistos->FillTH1("EnergyJetHigh", triggerpatch->GetPatchE());
+                               fHistos->FillTHnSparse("EnergyJetHigh", triggerpatchinfo);
                                if(triggerpatch->IsMainTrigger())
-                                       fHistos->FillTH1("EnergyMainJetHigh", triggerpatch->GetPatchE());
+                                       fHistos->FillTHnSparse("EnergyMainJetHigh", triggerpatchinfo);
                        }
                        if(triggerpatch->IsJetLow()){
-                               fHistos->FillTH1("EnergyJetLow", triggerpatch->GetPatchE());
+                               fHistos->FillTHnSparse("EnergyJetLow", triggerpatchinfo);
                                if(triggerpatch->IsMainTrigger())
-                                       fHistos->FillTH1("EnergyMainJetLow", triggerpatch->GetPatchE());
+                                       fHistos->FillTHnSparse("EnergyMainJetLow", triggerpatchinfo);
                        }
                        if(triggerpatch->IsGammaHigh()){
-                               fHistos->FillTH1("EnergyGammaHigh", triggerpatch->GetPatchE());
+                               fHistos->FillTHnSparse("EnergyGammaHigh", triggerpatchinfo);
                                if(triggerpatch->IsMainTrigger())
-                                       fHistos->FillTH1("EnergyMainGammaHigh", triggerpatch->GetPatchE());
+                                       fHistos->FillTHnSparse("EnergyMainGammaHigh", triggerpatchinfo);
                        }
                        if(triggerpatch->IsGammaLow()){
-                               fHistos->FillTH1("EnergyGammaLow", triggerpatch->GetPatchE());
+                               fHistos->FillTHnSparse("EnergyGammaLow", triggerpatchinfo);
                                if(triggerpatch->IsMainTrigger())
-                                       fHistos->FillTH1("EnergyMainGammaLow", triggerpatch->GetPatchE());
+                                       fHistos->FillTHnSparse("EnergyMainGammaLow", triggerpatchinfo);
                        }
                        if(triggerpatch->IsLevel0()){
-                               fHistos->FillTH1("EnergyLevel0", triggerpatch->GetPatchE());
+                               fHistos->FillTHnSparse("EnergyLevel0", triggerpatchinfo);
                                if(triggerpatch->IsMainTrigger())
-                                       fHistos->FillTH1("EnergyMainLevel0", triggerpatch->GetPatchE());
+                                       fHistos->FillTHnSparse("EnergyMainLevel0", triggerpatchinfo);
                        }
                }
 
@@ -371,6 +369,18 @@ namespace EMCalTriggerPtAnalysis {
                                FillEventHist(it->c_str(), zv, isPileupEvent);
                }
 
+               // Fill MC truth
+               if(fMCEvent){
+                       for(int ipart = 0; ipart < fMCEvent->GetNumberOfTracks(); ipart++){
+                               // Select only physical primary particles
+                               AliVParticle *part = fMCEvent->GetTrack(ipart);
+                               if(!fEtaRange.IsInRange(part->Eta())) continue;
+                               if(!fPtRange.IsInRange(part->Pt())) continue;
+                               if(!fMCEvent->IsPhysicalPrimary(ipart)) continue;
+                               FillMCParticleHist(part, zv, isPileupEvent);
+                       }
+               }
+
                AliVTrack *track(NULL);
                // Loop over all tracks (No cuts applied)
                TIter allTrackIter(fTracks);
@@ -699,14 +709,18 @@ namespace EMCalTriggerPtAnalysis {
        }
 
        //______________________________________________________________________________
-       void AliAnalysisTaskPtEMCalTrigger::FillMCParticleHist(const AliVParticle * const track){
+       void AliAnalysisTaskPtEMCalTrigger::FillMCParticleHist(const AliVParticle * const track, double vz, bool isPileup){
                /*
                 * Fill histogram for MC-true particles with the information pt, eta and phi
                 *
                 * @param track: the Monte-Carlo track
                 */
-               double data[3] = {TMath::Abs(track->Pt()), track->Eta(), track->Phi()};
+               double data[5] = {TMath::Abs(track->Pt()), track->Eta(), track->Phi(), vz, 0.};
                fHistos->FillTHnSparse("hMCtrueParticles", data);
+               if(!isPileup){
+                       data[4] = 1.;
+                       fHistos->FillTHnSparse("hMCtrueParticles", data);
+               }
        }
 
        //______________________________________________________________________________
index 434d6cb..f5afc87 100644 (file)
@@ -53,7 +53,7 @@ private:
        void FillEventHist(const char *trigger, double vz, bool isPileup);
        void FillTrackHist(const char *trigger, const AliVTrack *track, double vz, bool isPileup, int cut, bool isMinBias);
        void FillClusterHist(const char *trigger, const AliVCluster *clust, bool isCalibrated, double vz, bool isPileup, bool isMinBias);
-       void FillMCParticleHist(const AliVParticle * const part);
+       void FillMCParticleHist(const AliVParticle * const part, double vz, bool isPileup);
        bool IsTrueTrack(const AliVTrack *const) const;
        TString BuildTriggerString();
        const AliVVertex *GetSPDVertex() const;