]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskEmcalJetTriggerQA.cxx
Merge branch 'master' of https://git.cern.ch/reps/AliRoot
[u/mrichter/AliRoot.git] / PWGJE / EMCALJetTasks / UserTasks / AliAnalysisTaskEmcalJetTriggerQA.cxx
index c9662da94332abb57399d729fe49945b1e438085..c1ddb000ba40693a6633f400a28fca847043f0d8 100644 (file)
@@ -7,6 +7,7 @@
 #include <TH1F.h>
 #include <TH2F.h>
 #include <TH3F.h>
+#include <TProfile.h>
 #include <THnSparse.h>
 #include <TList.h>
 #include <TLorentzVector.h>
@@ -42,6 +43,7 @@ AliAnalysisTaskEmcalJetTriggerQA::AliAnalysisTaskEmcalJetTriggerQA() :
   fTriggerType(-1),
   fNFastOR(16),
   fhNEvents(0),
+  fhTriggerbit(0), 
   fHistRhovsCentFull(0),
   fHistRhovsCentCharged(0),
   fh3PtEtaPhiTracks(0),
@@ -79,6 +81,7 @@ AliAnalysisTaskEmcalJetTriggerQA::AliAnalysisTaskEmcalJetTriggerQA() :
   fh3PatchADCEnergyEtaPhiCenterJ1J2(0),
   fh3PatchADCEnergyEtaPhiCenterAll(0),
   fh3EEtaPhiCell(0),
+  fh2ECellVsCent(0),
   fh2CellEnergyVsTime(0),
   fh3EClusELeadingCellVsTime(0),
   fh3JetReacCent(0)
@@ -99,6 +102,7 @@ AliAnalysisTaskEmcalJetTriggerQA::AliAnalysisTaskEmcalJetTriggerQA(const char *n
   fTriggerType(-1),
   fNFastOR(16),
   fhNEvents(0),
+  fhTriggerbit(0),
   fHistRhovsCentFull(0),
   fHistRhovsCentCharged(0),
   fh3PtEtaPhiTracks(0),
@@ -136,6 +140,7 @@ AliAnalysisTaskEmcalJetTriggerQA::AliAnalysisTaskEmcalJetTriggerQA(const char *n
   fh3PatchADCEnergyEtaPhiCenterJ1J2(0),
   fh3PatchADCEnergyEtaPhiCenterAll(0),
   fh3EEtaPhiCell(0),
+  fh2ECellVsCent(0),
   fh2CellEnergyVsTime(0),
   fh3EClusELeadingCellVsTime(0),
   fh3JetReacCent(0)
@@ -149,11 +154,7 @@ AliAnalysisTaskEmcalJetTriggerQA::AliAnalysisTaskEmcalJetTriggerQA(const char *n
 AliAnalysisTaskEmcalJetTriggerQA::~AliAnalysisTaskEmcalJetTriggerQA()
 {
   // Destructor.
-  if (fOutput) {
-    delete fOutput;  // delete output object list
-    fOutput = 0;
-  }
-
 }
 
 //________________________________________________________________________
@@ -170,7 +171,7 @@ Bool_t AliAnalysisTaskEmcalJetTriggerQA::SelectEvent() {
     TString trigType2 = "J2";
     if(fTriggerClass.Contains("G")) {
       trigType1 = "G1";
-      trigType1 = "G2";
+      trigType2 = "G2";
     }
 
     TString firedTrigClass = InputEvent()->GetFiredTriggerClasses();
@@ -228,6 +229,9 @@ void AliAnalysisTaskEmcalJetTriggerQA::UserCreateOutputObjects()
   fhNEvents = new TH1F("fhNEvents","fhNEvents;selection;N_{evt}",5,0,5);
   fOutput->Add(fhNEvents);
 
+  fhTriggerbit = new TProfile("fhTriggerbit","fhTriggerbit;;TriggerBit",1,0,1);
+  fOutput->Add(fhTriggerbit);
+
   fHistRhovsCentFull = new TH2F("fHistRhovsCentFull", "fHistRhovsCentFull", 101, -1,  100, 300, 0., 300.);
   fHistRhovsCentFull->GetXaxis()->SetTitle("Centrality (%)");
   fHistRhovsCentFull->GetYaxis()->SetTitle("s#rho_{ch} (GeV/c * rad^{-1})");
@@ -439,9 +443,12 @@ void AliAnalysisTaskEmcalJetTriggerQA::UserCreateOutputObjects()
   fh3PatchADCEnergyEtaPhiCenterAll = new TH3F("fh3PatchADCEnergyEtaPhiCenterAll","fh3PatchADCEnergyEtaPhiCenterAll;E_{ADC,patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
   fOutput->Add(fh3PatchADCEnergyEtaPhiCenterAll);
 
-  fh3EEtaPhiCell = new TH3F("fh3EEtaPhiCell","fh3EEtaPhiCell;E_{clus};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
+  fh3EEtaPhiCell = new TH3F("fh3EEtaPhiCell","fh3EEtaPhiCell;E_{cell};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
   fOutput->Add(fh3EEtaPhiCell);
 
+  fh2ECellVsCent = new TH2F("fh2ECellVsCent","fh2ECellVsCent;centrality;E_{cell}",101,-1,100,500,0.,5.);
+  fOutput->Add(fh2ECellVsCent);
+
   fh2CellEnergyVsTime = new TH2F("fh2CellEnergyVsTime","fh2CellEnergyVsTime;E_{cell};time",fgkNEnBins,binsEn,fgkNTimeBins,binsTime);
   fOutput->Add(fh2CellEnergyVsTime);
 
@@ -564,6 +571,7 @@ Bool_t AliAnalysisTaskEmcalJetTriggerQA::FillHistograms()
       AliDebug(2,Form("cell energy = %f  time = %f",cellE,cellT*1e9));
       fh2CellEnergyVsTime->Fill(cellE,cellT*1e9);
       fh3EEtaPhiCell->Fill(cellE,cellEta,cellPhi);
+      fh2ECellVsCent->Fill(fCent,cellE);
     }
   }
 
@@ -679,9 +687,8 @@ Bool_t AliAnalysisTaskEmcalJetTriggerQA::FillHistograms()
     }
   }
 
-  if(GetJetContainer(fContainerFull) && GetJetContainer(fContainerCharged)) {
+  if(GetJetContainer(fContainerFull) && GetJetContainer(fContainerCharged))
     fh2PtLeadJet1VsLeadJet2->Fill(ptLeadJet1,ptLeadJet2);
-  }
 
   fh3PtLeadJet1VsPatchEnergy->Fill(ptLeadJet1,fMaxPatchEnergy,fTriggerType);
   fh3PtLeadJet2VsPatchEnergy->Fill(ptLeadJet2,fMaxPatchEnergy,fTriggerType);
@@ -696,6 +703,8 @@ Bool_t AliAnalysisTaskEmcalJetTriggerQA::Run()
 {
   // Run analysis code here, if needed. It will be executed before FillHistograms().
 
+  fhTriggerbit->Fill(0.5,GetCollisionCandidates());
+
   //Check if event is selected (vertex & pile-up)
   if(!SelectEvent())
     return kFALSE;
@@ -719,7 +728,7 @@ Double_t AliAnalysisTaskEmcalJetTriggerQA::GetZ(const AliVParticle *trk, const A
 }
 
 //________________________________________________________________________
-Double_t AliAnalysisTaskEmcalJetTriggerQA::GetZ(const Double_t trkPx, const Double_t trkPy, const Double_t trkPz, const Double_t jetPx, const Double_t jetPy, const Double_t jetPz) const
+Double_t AliAnalysisTaskEmcalJetTriggerQA::GetZ(Double_t trkPx, Double_t trkPy, Double_t trkPz, Double_t jetPx, Double_t jetPy, Double_t jetPz) const
 {
   // 
   // Get the z of a constituent inside of a jet
@@ -752,7 +761,6 @@ Int_t AliAnalysisTaskEmcalJetTriggerQA::GetLeadingCellId(const AliVCluster *clus
       iCellAbsIdMax = absId;
     }
   }
-
   return iCellAbsIdMax;
 }