]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
add SS weight studies histograms
authorgconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 10 Apr 2013 09:48:39 +0000 (09:48 +0000)
committergconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 10 Apr 2013 09:48:39 +0000 (09:48 +0000)
PWGGA/CaloTrackCorrelations/AliAnaInsideClusterInvariantMass.cxx
PWGGA/CaloTrackCorrelations/AliAnaInsideClusterInvariantMass.h

index 40de594d00ffc48e5039affb131a9f0fc4712a0d..9b96d6c8f1c968a9a1aa06d4e028ad1805cc196e 100755 (executable)
@@ -59,6 +59,8 @@ AliAnaInsideClusterInvariantMass::AliAnaInsideClusterInvariantMass() :
   fFillTMResidualHisto(kFALSE),
   fFillSSExtraHisto(kFALSE),
   fFillMCFractionHisto(kFALSE),
+  fFillSSWeightHisto(kFALSE),
+  fSSWeightN(0),
   fhMassM02CutNLocMax1(0),    fhMassM02CutNLocMax2(0),    fhMassM02CutNLocMaxN(0),
   fhAsymM02CutNLocMax1(0),    fhAsymM02CutNLocMax2(0),    fhAsymM02CutNLocMaxN(0),
   fhMassSplitECutNLocMax1(0), fhMassSplitECutNLocMax2(0), fhMassSplitECutNLocMaxN(0),
@@ -250,10 +252,93 @@ AliAnaInsideClusterInvariantMass::AliAnaInsideClusterInvariantMass() :
     fhMCAsymM02NLocMaxNMCPi0Ebin[i] = 0 ;
   }
   
+  
+  for(Int_t nlm = 0; nlm < 3; nlm++)
+  {
+    fhPi0CellE       [nlm] = 0 ;
+    fhPi0CellEFrac   [nlm] = 0 ;
+    fhPi0CellLogEFrac[nlm] = 0 ;
+    
+    for(Int_t i = 0; i < 10; i++)
+      fhM02WeightPi0[nlm][i] = 0;
+  }
+  
   InitParameters();
   
 }
 
+//_______________________________________________________________________________________
+void AliAnaInsideClusterInvariantMass::FillSSWeightHistograms(AliVCluster *clus, Int_t nlm)
+{
+  // Calculate weights and fill histograms
+  
+  if(!fFillSSWeightHisto) return;
+  
+  AliVCaloCells* cells = 0;
+  if(fCalorimeter == "EMCAL") cells = GetEMCALCells();
+  else                        cells = GetPHOSCells();
+  
+  // First recalculate energy in case non linearity was applied
+  Float_t  energy = 0;
+  for (Int_t ipos = 0; ipos < clus->GetNCells(); ipos++)
+  {
+    
+    Int_t id       = clus->GetCellsAbsId()[ipos];
+    
+    //Recalibrate cell energy if needed
+    Float_t amp = cells->GetCellAmplitude(id);
+    GetCaloUtils()->RecalibrateCellAmplitude(amp,fCalorimeter, id);
+    
+    energy    += amp;
+      
+  } // energy loop
+  
+  if(energy <=0 )
+  {
+    printf("AliAnaInsideClusterInvatiantMass::WeightHistograms()- Wrong calculated energy %f\n",energy);
+    return;
+  }
+  
+   
+  //Get the ratio and log ratio to all cells in cluster
+  for (Int_t ipos = 0; ipos < clus->GetNCells(); ipos++)
+  {
+    Int_t id       = clus->GetCellsAbsId()[ipos];
+    
+    //Recalibrate cell energy if needed
+    Float_t amp = cells->GetCellAmplitude(id);
+    GetCaloUtils()->RecalibrateCellAmplitude(amp,fCalorimeter, id);
+    
+    fhPi0CellE       [nlm]->Fill(energy,amp);
+    fhPi0CellEFrac   [nlm]->Fill(energy,amp/energy);
+    fhPi0CellLogEFrac[nlm]->Fill(energy,TMath::Log(amp/energy));
+  }
+  
+  //Recalculate shower shape for different W0
+  if(fCalorimeter=="EMCAL")
+  {
+    Float_t l0org = clus->GetM02();
+    Float_t l1org = clus->GetM20();
+    Float_t dorg  = clus->GetDispersion();
+    
+    for(Int_t iw = 0; iw < fSSWeightN; iw++)
+    {
+      GetCaloUtils()->GetEMCALRecoUtils()->SetW0(fSSWeight[iw]);
+      GetCaloUtils()->GetEMCALRecoUtils()->RecalculateClusterShowerShapeParameters(GetEMCALGeometry(), cells, clus);
+      
+      fhM02WeightPi0[nlm][iw]->Fill(energy,clus->GetM02());
+      
+    } // w0 loop
+    
+    // Set the original values back
+    clus->SetM02(l0org);
+    clus->SetM20(l1org);
+    clus->SetDispersion(dorg);
+    
+  }// EMCAL
+}
+
+
 //_______________________________________________________________
 TObjString *  AliAnaInsideClusterInvariantMass::GetAnalysisCuts()
 {      
@@ -1510,6 +1595,45 @@ TList * AliAnaInsideClusterInvariantMass::GetCreateOutputObjects()
   outputContainer->Add(fhEtaEtaPhiNLocMaxN) ;
 
   
+  if(fFillSSWeightHisto)
+  {
+    TString snlm[] = {"1","2","N"};
+    for(Int_t nlm = 0; nlm < 3; nlm++)
+    {
+      fhPi0CellE[nlm]  = new TH2F(Form("hPi0CellENLocMax%s",snlm[nlm].Data()),
+                                  Form("Selected #pi^{0}'s, NLM = %s: cluster E vs cell E",snlm[nlm].Data()),
+                                  nptbins,ptmin,ptmax, nptbins,ptmin,ptmax);
+      fhPi0CellE[nlm]->SetYTitle("E_{cell}");
+      fhPi0CellE[nlm]->SetXTitle("E_{cluster}");
+      outputContainer->Add(fhPi0CellE[nlm]) ;
+      
+      fhPi0CellEFrac[nlm]  = new TH2F(Form("hPi0CellEFracNLocMax%s",snlm[nlm].Data()),
+                                      Form("Selected #pi^{0}'s, NLM = %s: cluster E vs cell E / cluster E",snlm[nlm].Data()),
+                                      nptbins,ptmin,ptmax, 100,0,1);
+      fhPi0CellEFrac[nlm]->SetYTitle("E_{cell} / E_{cluster}");
+      fhPi0CellEFrac[nlm]->SetXTitle("E_{cluster}");
+      outputContainer->Add(fhPi0CellEFrac[nlm]) ;
+      
+      fhPi0CellLogEFrac[nlm]  = new TH2F(Form("hPi0CellLogEFracNLocMax%s",snlm[nlm].Data()),
+                                      Form("Selected #pi^{0}'s, NLM = %s: cluster E vs Log(cell E / cluster E)",snlm[nlm].Data()),
+                                      nptbins,ptmin,ptmax, 100,-10,0);
+      fhPi0CellLogEFrac[nlm]->SetYTitle("Log(E_{cell} / E_{cluster})");
+      fhPi0CellLogEFrac[nlm]->SetXTitle("E_{cluster}");
+      outputContainer->Add(fhPi0CellLogEFrac[nlm]) ;
+
+      
+      for(Int_t i = 0; i < fSSWeightN; i++)
+      {
+        fhM02WeightPi0[nlm][i]     = new TH2F(Form("hM02Pi0NLocMax%s_W%d",snlm[nlm].Data(),i),
+                                              Form("#lambda_{0}^{2} vs E, with W0 = %2.2f, for N Local max = %s", fSSWeight[i], snlm[nlm].Data()),
+                                              nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
+        fhM02WeightPi0[nlm][i]   ->SetYTitle("#lambda_{0}^{2}");
+        fhM02WeightPi0[nlm][i]   ->SetXTitle("E (GeV)");
+        outputContainer->Add(fhM02WeightPi0[nlm][i]) ;
+      }
+    }
+  }
+  
   return outputContainer ;
   
 }
@@ -1552,7 +1676,10 @@ void AliAnaInsideClusterInvariantMass::InitParameters()
   
   fMinNCells   = 4 ;
   fMinBadDist  = 2 ;
-    
+  
+  fSSWeightN   = 5;
+  fSSWeight[0] = 4.6;  fSSWeight[1] = 4.7; fSSWeight[2] = 4.8; fSSWeight[3] = 4.9; fSSWeight[4] = 5.0;
+  fSSWeight[5] = 5.1;  fSSWeight[6] = 5.2; fSSWeight[7] = 5.3; fSSWeight[8] = 5.4; fSSWeight[9] = 5.5;
 }
 
 
@@ -2004,6 +2131,7 @@ void  AliAnaInsideClusterInvariantMass::MakeAnalysisFillHistograms()
         {
           fhEventPlanePi0NLocMax1->Fill(en,evp) ;
           if(en > ecut)fhPi0EtaPhiNLocMax1->Fill(eta,phi);
+          FillSSWeightHistograms(cluster, 0);
         }
       }
       else if(pidTag==AliCaloPID::kEta)
@@ -2063,6 +2191,7 @@ void  AliAnaInsideClusterInvariantMass::MakeAnalysisFillHistograms()
         {
           fhEventPlanePi0NLocMax2->Fill(en,evp) ;
           if(en > ecut)fhPi0EtaPhiNLocMax2->Fill(eta,phi);
+          FillSSWeightHistograms(cluster, 1);
         }
       }
       else if(pidTag==AliCaloPID::kEta)
@@ -2122,6 +2251,7 @@ void  AliAnaInsideClusterInvariantMass::MakeAnalysisFillHistograms()
         {
           fhEventPlanePi0NLocMaxN->Fill(en,evp) ;
           if(en > ecut)fhPi0EtaPhiNLocMaxN->Fill(eta,phi);
+          FillSSWeightHistograms(cluster, 2);
         }
       }
       else if(pidTag==AliCaloPID::kEta)
index 39d8155ca2c3917b8365427bac26dcfd6e09aaed..39eb70e5f7206e6d671a8dae15d8f4abc53ef5ca 100755 (executable)
@@ -33,7 +33,9 @@ class AliAnaInsideClusterInvariantMass : public AliAnaCaloTrackCorrBaseClass {
   TObjString * GetAnalysisCuts();
   
   TList      * GetCreateOutputObjects();
-    
+  
+  void         FillSSWeightHistograms(AliVCluster *clus, Int_t nlm);
+  
   void         Init();
   
   void         InitParameters();
@@ -62,6 +64,12 @@ class AliAnaInsideClusterInvariantMass : public AliAnaCaloTrackCorrBaseClass {
   void         SwitchOnMCFractionHistograms()            { fFillMCFractionHisto = kTRUE  ; }
   void         SwitchOffMCFractionHistograms()           { fFillMCFractionHisto = kFALSE ; }
 
+  void         SwitchOnFillSSWeightHistograms()           { fFillSSWeightHisto   = kTRUE  ; }
+  void         SwitchOffFillSSWeightHistograms()          { fFillSSWeightHisto   = kFALSE ; }
+  
+  void         SetNWeightForShowerShape(Int_t n)         { fSSWeightN = n ; }
+  void         SetWeightForShowerShape(Int_t i, Float_t v) { if (i < 10) fSSWeight[i] = v ; }
+
   
   //For histograms
   enum mcTypes { kmcPhoton = 1, kmcConversion = 2, kmcPi0    = 3,  
@@ -79,7 +87,11 @@ class AliAnaInsideClusterInvariantMass : public AliAnaCaloTrackCorrBaseClass {
   Bool_t       fFillTMResidualHisto ;  // Fill track matching histos, residuals
   Bool_t       fFillSSExtraHisto ;     // Fill shower shape extra histos
   Bool_t       fFillMCFractionHisto ;  // Fill MC energy fraction histos
+  Bool_t       fFillSSWeightHisto ;    // Fill weigth histograms
 
+  Float_t      fSSWeight[10];          // List of weights to test
+  Float_t      fSSWeightN;             // Total number of weights to test
+  
   //Histograms
   
   TH2F       * fhMassNLocMax1[8][2]  ;                  //! Mass of 2 highest energy cells when 1 local max vs E, 1-6 for different MC particle types 
@@ -287,6 +299,12 @@ class AliAnaInsideClusterInvariantMass : public AliAnaCaloTrackCorrBaseClass {
   TH2F       * fhEtaEtaPhiNLocMax2 ;                    //! Eta vs Phi of eta's with N Local Maxima = 2, E > 8 GeV
   TH2F       * fhEtaEtaPhiNLocMaxN ;                    //! Eta vs Phi of eta's with N Local Maxima > N, E > 8 GeV
 
+  TH2F       * fhPi0CellE[3] ;                          //! pi0's energy vs cluster cell energy with NLM = 1, = 2, > 2 
+  TH2F       * fhPi0CellEFrac[3] ;                      //! pi0's energy vs cluster cell energy fraction with NLM = 1, = 2, > 2 
+  TH2F       * fhPi0CellLogEFrac[3] ;                   //! pi0's energy vs cluster log cell energy fraction with NLM = 1, = 2, > 2
+  TH2F       * fhM02WeightPi0[3][10] ;                  //! M02 for selected pi0 with different weight, with NLM = 1, = 2, > 2
+
+  
   AliAnaInsideClusterInvariantMass(              const AliAnaInsideClusterInvariantMass & split) ; // cpy ctor
   AliAnaInsideClusterInvariantMass & operator = (const AliAnaInsideClusterInvariantMass & split) ; // cpy assignment