Updating task for p-A
authorcoppedis <coppedis@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 28 Jan 2013 11:24:52 +0000 (11:24 +0000)
committercoppedis <coppedis@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 28 Jan 2013 11:24:52 +0000 (11:24 +0000)
PWGPP/ZDC/AliAnalysisTaskZDCpA.cxx
PWGPP/ZDC/AliAnalysisTaskZDCpA.h

index 9bad9f4..3a4e572 100644 (file)
@@ -61,12 +61,14 @@ AliAnalysisTaskZDCpA::AliAnalysisTaskZDCpA():
     fDebug(0),
     fIsMCInput(kFALSE),
     fOutput(0x0),
+    fhTDCZNC(0x0),
+    fhTDCZNA(0x0),
     fhTDCZNSum(0x0),
     fhTDCZNDiff(0x0),
-    fhZNCSpectrum(0x0),
-    fhZNASpectrum(0x0),
-    fhZPCSpectrum(0x0),
-    fhZPASpectrum(0x0),
+    fhZNCSumQ(0x0),
+    fhZNASumQ(0x0),
+    fhZPCSumQ(0x0),
+    fhZPASumQ(0x0),
     fhZEM1Spectrum(0x0),
     fhZEM2Spectrum(0x0),
     fhZNCpmc(0x0),      
@@ -75,8 +77,6 @@ AliAnalysisTaskZDCpA::AliAnalysisTaskZDCpA():
     fhZPApmc(0x0),      
     fhZNCCentroid(0x0), 
     fhZNACentroid(0x0), 
-    fhZNCemd(0x0),        
-    fhZNAemd(0x0),
     fhPMCZNCemd(0x0), 
     fhPMCZNAemd(0x0),
     fDebunch(0x0)
@@ -90,12 +90,14 @@ AliAnalysisTaskZDCpA::AliAnalysisTaskZDCpA(const char *name):
     fDebug(0),
     fIsMCInput(kFALSE),
     fOutput(0x0),
+    fhTDCZNC(0x0),
+    fhTDCZNA(0x0),
     fhTDCZNSum(0x0),
     fhTDCZNDiff(0x0),
-    fhZNCSpectrum(0x0),
-    fhZNASpectrum(0x0),
-    fhZPCSpectrum(0x0),
-    fhZPASpectrum(0x0),
+    fhZNCSumQ(0x0),
+    fhZNASumQ(0x0),
+    fhZPCSumQ(0x0),
+    fhZPASumQ(0x0),
     fhZEM1Spectrum(0x0),
     fhZEM2Spectrum(0x0),
     fhZNCpmc(0x0),      
@@ -104,11 +106,9 @@ AliAnalysisTaskZDCpA::AliAnalysisTaskZDCpA(const char *name):
     fhZPApmc(0x0),      
     fhZNCCentroid(0x0), 
     fhZNACentroid(0x0), 
-    fhZNCemd(0x0),        
-    fhZNAemd(0x0),
     fhPMCZNCemd(0x0), 
     fhPMCZNAemd(0x0),
-    fDebunch(0x0) 
+    fDebunch(0x0)
 {  
   // Output slot #1 writes into a TList container
   DefineOutput(1, TList::Class()); 
@@ -133,12 +133,14 @@ AliAnalysisTaskZDCpA::AliAnalysisTaskZDCpA(const AliAnalysisTaskZDCpA& ana):
   fDebug(ana.fDebug),    
   fIsMCInput(ana.fIsMCInput),
   fOutput(ana.fOutput),
+  fhTDCZNC(ana.fhTDCZNC),
+  fhTDCZNA(ana.fhTDCZNA),
   fhTDCZNSum(ana.fhTDCZNSum),
   fhTDCZNDiff(ana.fhTDCZNDiff),
-  fhZNCSpectrum(ana.fhZNCSpectrum),
-  fhZNASpectrum(ana.fhZNASpectrum),
-  fhZPCSpectrum(ana.fhZPCSpectrum),
-  fhZPASpectrum(ana.fhZPASpectrum),
+  fhZNCSumQ(ana.fhZNCSumQ),
+  fhZNASumQ(ana.fhZNASumQ),
+  fhZPCSumQ(ana.fhZPCSumQ),
+  fhZPASumQ(ana.fhZPASumQ),
   fhZEM1Spectrum(ana.fhZEM1Spectrum),
   fhZEM2Spectrum(ana.fhZEM2Spectrum),
   fhZNCpmc(ana.fhZNCpmc),       
@@ -147,8 +149,6 @@ AliAnalysisTaskZDCpA::AliAnalysisTaskZDCpA(const AliAnalysisTaskZDCpA& ana):
   fhZPApmc(ana.fhZPApmc),       
   fhZNCCentroid(ana.fhZNCCentroid), 
   fhZNACentroid(ana.fhZNACentroid), 
-  fhZNCemd(ana.fhZNCemd),       
-  fhZNAemd(ana.fhZNAemd),
   fhPMCZNCemd(ana.fhPMCZNCemd), 
   fhPMCZNAemd(ana.fhPMCZNAemd),
   fDebunch(ana.fDebunch)
@@ -177,34 +177,42 @@ void AliAnalysisTaskZDCpA::UserCreateOutputObjects()
   fOutput->SetOwner();
   //fOutput->SetName("output");
   
-  fhTDCZNSum = new TH1F("fhTDCZNSum","TDC_{ZNC}+TDC_{ZNA}",60,-30.,30.);
+  fhTDCZNC = new TH1F("fhTDCZNC","TDC_{ZNC}",160, -60., -20.);
+  fhTDCZNC->GetXaxis()->SetTitle("TDC_{ZNC} (ns)");
+  fOutput->Add(fhTDCZNC);      
+  
+  fhTDCZNA = new TH1F("fhTDCZNA","TDC_{ZNA}",160, -60., -20.);
+  fhTDCZNA->GetXaxis()->SetTitle("TDC_{ZNA} (ns)");
+  fOutput->Add(fhTDCZNA);     
+  
+  fhTDCZNSum = new TH1F("fhTDCZNSum","TDC_{ZNC}+TDC_{ZNA}",120,-30.,30.);
   fhTDCZNSum->GetXaxis()->SetTitle("TDC_{ZNC}+TDC_{ZNA} (ns)");
   fOutput->Add(fhTDCZNSum);      
   
-  fhTDCZNDiff = new TH1F("fhTDCZNDiff","TDC_{ZNC}-TDC_{ZNA}",60,-30.,30.);
+  fhTDCZNDiff = new TH1F("fhTDCZNDiff","TDC_{ZNC}-TDC_{ZNA}",120,-30.,30.);
   fhTDCZNDiff->GetXaxis()->SetTitle("TDC_{ZNC}-TDC_{ZNA} (ns)");
   fOutput->Add(fhTDCZNDiff);     
   
-  fhZNCSpectrum = new TH1F("fhZNCSpectrum", "ZNC signal", 250,0., 2500.);
-  fOutput->Add(fhZNCSpectrum);      
-  fhZNASpectrum = new TH1F("fhZNASpectrum", "ZNA signal", 250,0., 2500.) ;
-  fOutput->Add(fhZNASpectrum);      
-  fhZPCSpectrum = new TH1F("fhZPCSpectrum", "ZPC signal", 200,0., 2000.) ;
-  fOutput->Add(fhZPCSpectrum);      
-  fhZPASpectrum = new TH1F("fhZPASpectrum", "ZPA signal", 200,0., 2000.) ;
-  fOutput->Add(fhZPASpectrum);      
+  fhZNCSumQ = new TH1F("fhZNCSumQ", "ZNC sumPMQ_i signal", 250,0., 2000.);
+  fOutput->Add(fhZNCSumQ);      
+  fhZNASumQ = new TH1F("fhZNASumQ", "ZNA sumPMQ_i signal", 250,0., 2000.) ;
+  fOutput->Add(fhZNASumQ);      
+  fhZPCSumQ = new TH1F("fhZPCSumQ", "ZPC sumPMQ_i signal", 200,0., 2000.) ;
+  fOutput->Add(fhZPCSumQ);      
+  fhZPASumQ = new TH1F("fhZPASumQ", "ZPA sumPMQ_i signal", 200,0., 2000.) ;
+  fOutput->Add(fhZPASumQ);      
   fhZEM1Spectrum = new TH1F("fhZEM1Spectrum", "ZEM1 signal", 100,0., 2500.);
   fOutput->Add(fhZEM1Spectrum);      
   fhZEM2Spectrum = new TH1F("fhZEM2Spectrum", "ZEM2 signal", 100,0., 2500.);
   fOutput->Add(fhZEM2Spectrum);      
   
-  fhZNCpmc = new TH1F("fhZNCpmc","ZNC PMC",200, 0., 2000.);
+  fhZNCpmc = new TH1F("fhZNCpmc","ZNC PMC", 200, 0., 2000.);
   fOutput->Add(fhZNCpmc);      
-  fhZNApmc = new TH1F("fhZNApmc","ZNA PMC",200, 0., 12000.); 
+  fhZNApmc = new TH1F("fhZNApmc","ZNA PMC", 200, 0., 2000.); 
   fOutput->Add(fhZNApmc);      
-  fhZPCpmc = new TH1F("fhZPCpmc","ZPC PMC",200, 0., 2000.); 
+  fhZPCpmc = new TH1F("fhZPCpmc","ZPC PMC", 200, 0., 2000.); 
   fOutput->Add(fhZPCpmc);      
-  fhZPApmc = new TH1F("fhZPApmc","ZPA PMC",200, 0., 2000.); 
+  fhZPApmc = new TH1F("fhZPApmc","ZPA PMC", 200, 0., 2000.); 
   fOutput->Add(fhZPApmc);      
   
   fhZNCCentroid = new TH2F("fhZNCCentroid","Centroid over ZNC",70,-3.5,3.5,70,-3.5,3.5); 
@@ -212,10 +220,6 @@ void AliAnalysisTaskZDCpA::UserCreateOutputObjects()
   fhZNACentroid = new TH2F("fhZNACentroid","Centroid over ZNA",70,-3.5,3.5,70,-3.5,3.5); 
   fOutput->Add(fhZNACentroid);      
   
-  fhZNCemd = new TH1F("fhZNCemd","ZNC signal lg",200,0.,6000.);         
-  fOutput->Add(fhZNCemd);      
-  fhZNAemd = new TH1F("fhZNAemd","ZNA signal lg",200,0.,6000.);         
-  fOutput->Add(fhZNAemd);      
   fhPMCZNCemd = new TH1F("fhPMCZNCemd","ZNC PMC lg",200, 10., 6000.);   
   fOutput->Add(fhPMCZNCemd);      
   fhPMCZNAemd = new TH1F("fhPMCZNAemd","ZNA PMC lg",200, 10., 6000.);   
@@ -267,11 +271,7 @@ void AliAnalysisTaskZDCpA::UserExec(Option_t */*option*/)
   AliESDZDC *esdZDC = esd->GetESDZDC();
   
 //  if((((AliInputEventHandler*)(am->GetInputEventHandler()))->IsEventSelected())){
-  
-    fhZNCSpectrum->Fill(esdZDC->GetZDCN1Energy());       
-    fhZNASpectrum->Fill(esdZDC->GetZDCN2Energy());
-    fhZPCSpectrum->Fill(esdZDC->GetZDCP1Energy());               
-    fhZPASpectrum->Fill(esdZDC->GetZDCP2Energy());       
+
     fhZEM1Spectrum->Fill(esdZDC->GetZDCEMEnergy(0));
     fhZEM2Spectrum->Fill(esdZDC->GetZDCEMEnergy(1));
   
@@ -283,7 +283,20 @@ void AliAnalysisTaskZDCpA::UserExec(Option_t */*option*/)
     fhZNCpmc->Fill(towZNC[0]);    
     fhZNApmc->Fill(towZNA[0]);    
     fhZPCpmc->Fill(towZPC[0]);    
-    fhZPApmc->Fill(towZPA[0]);    
+    fhZPApmc->Fill(towZPA[0]);
+    //
+    Float_t sumQZNC=0., sumQZNA=0., sumQZPC=0., sumQZPA=0.;
+    for(int iq=1; iq<5; iq++){
+       sumQZNC += towZNC[iq];
+       sumQZNA += towZNA[iq];
+       sumQZPC += towZPC [iq];
+       sumQZPA += towZNC[iq];
+    }     
+  
+    fhZNCSumQ->Fill(sumQZNC);    
+    fhZNASumQ->Fill(sumQZNA);
+    fhZPCSumQ->Fill(sumQZPC);            
+    fhZPASumQ->Fill(sumQZPA);    
   
     Double_t xyZNC[2]={-99.,-99.}, xyZNA[2]={-99.,-99.};
     esdZDC->GetZNCentroidInpp(xyZNC, xyZNA);
@@ -293,32 +306,25 @@ void AliAnalysisTaskZDCpA::UserExec(Option_t */*option*/)
     
     const Double_t * towZNCLG = esdZDC->GetZN1TowerEnergyLR();
     const Double_t * towZNALG = esdZDC->GetZN2TowerEnergyLR();
-    Double_t znclg=0., znalg=0.;
-    for(Int_t iq=0; iq<5; iq++){
-       znclg += towZNCLG[iq];
-       znalg += towZNALG[iq];
-    }
-    fhZNCemd->Fill(znclg/2.);   
-    fhZNAemd->Fill(znalg/2.);   
     fhPMCZNCemd->Fill(towZNCLG[0]);   
     fhPMCZNAemd->Fill(towZNALG[0]);   
   
 //  }
     
-  Float_t tdcC=999., tdcA=999;
-  Float_t tdcSum=999., tdcDiff=999;
   for(int i=0; i<4; i++){
-    if(esdZDC->GetZDCTDCData(10,i) != 0.){
-      tdcC = esdZDC->GetZDCTDCCorrected(10,i);
-      if(esdZDC->GetZDCTDCData(12,i) != 0.){
-        tdcA = esdZDC->GetZDCTDCCorrected(12,i);
-        tdcSum = tdcC+tdcA;
-        tdcDiff = tdcC-tdcA;
+    Float_t tdcC = 0.025*(esdZDC->GetZDCTDCData(10,i));
+    Float_t tdcA = 0.025*(esdZDC->GetZDCTDCData(12,i));
+    Float_t tdcL0 = 0.025*(esdZDC->GetZDCTDCData(15,i));
+    //
+    if(tdcC != 0.){
+      fhTDCZNC->Fill(tdcC-tdcL0);
+      if(tdcA != 0.){
+        fhTDCZNA->Fill(tdcA-tdcL0);
+        fhTDCZNDiff->Fill(tdcC-tdcA);
+        fhTDCZNSum->Fill(tdcC+tdcA-2*tdcL0);
+       fDebunch->Fill(tdcC-tdcA, tdcC+tdcA-2*tdcL0);
       }
     }
-    if(tdcSum!=999.) fhTDCZNSum->Fill(tdcSum); 
-    if(tdcDiff!=999.)fhTDCZNDiff->Fill(tdcDiff); 
-    if(tdcSum!=999. && tdcDiff!=999.)  fDebunch->Fill(tdcDiff, tdcSum);  
   }
   
   PostData(1, fOutput);
index 79800c5..fb0f576 100644 (file)
@@ -42,12 +42,14 @@ class AliAnalysisTaskZDCpA : public AliAnalysisTaskSE {
   Bool_t   fIsMCInput;         // true when input is MC
   //
   TList   *fOutput;            //! list send on output slot 0
+  TH1F    *fhTDCZNC;           //! TDC ZNC sum
+  TH1F    *fhTDCZNA;           //! TDC DIFF sum
   TH1F    *fhTDCZNSum;         //! TDC ZNC sum
   TH1F    *fhTDCZNDiff;        //! TDC DIFF sum
-  TH1F    *fhZNCSpectrum;      //! ZNC spectra
-  TH1F    *fhZNASpectrum;      //! ZNA spectra
-  TH1F    *fhZPCSpectrum;      //! ZPC spectra
-  TH1F    *fhZPASpectrum;      //! ZPA spectra
+  TH1F    *fhZNCSumQ;          //! ZNC sum 4Q
+  TH1F    *fhZNASumQ;          //! ZNA sum 4Q
+  TH1F    *fhZPCSumQ;          //! ZPC sum 4Q
+  TH1F    *fhZPASumQ;          //! ZPA sum 4Q
   TH1F    *fhZEM1Spectrum;     //! ZEM1 spectra
   TH1F    *fhZEM2Spectrum;     //! ZEM2 spectra
   TH1F    *fhZNCpmc;           //! ZNC PMCs
@@ -56,14 +58,12 @@ class AliAnalysisTaskZDCpA : public AliAnalysisTaskSE {
   TH1F    *fhZPApmc;           //! ZPA PMCs
   TH2F    *fhZNCCentroid;       //! ZNC centroid
   TH2F    *fhZNACentroid;       //! ZNA centroid
-  TH1F    *fhZNCemd;           //! ZNC sum low gain chain
-  TH1F    *fhZNAemd;           //! ZNA sum gain chain
   TH1F    *fhPMCZNCemd;        //! ZNC PMC low gain chain
   TH1F    *fhPMCZNAemd;        //! ZNA PMC low gain chain
   TH2F    *fDebunch;            //! TDC sum vs. diff
   
  
-  ClassDef(AliAnalysisTaskZDCpA,1); 
+  ClassDef(AliAnalysisTaskZDCpA,2); 
 
 };